const {request} = require('../utils/request');


const getHotSong = (limit = 10, offset = 0) => {
    const playlistId = 3778678;
    return request.get('/playlist/track/all', {
        params: {
            id: playlistId,
            limit: limit,
            offset: offset,
        }
    });
}

const getSongUrl = (id, level = 'standard', cookie = '') => {
    return request.post('/song/url/v1', {
        cookie
    }, {
        params: {
            id,
            level
        }
    })
}

const getArtistInfo = (id) => {
    return request.get('/artist/detail', {
        params: {
            id
        }
    })
}

const getMvUrl = (id) => {
    return request.get('/mv/url', {
        params: {
            id, r: 1080
        }
    })
}

const getAlbumInfo = (id) => {
    return request.get('/album', {
        params: {
            id
        }
    })
}

const getRecommendVideo = (cookie) => {
    return request.post('/video/timeline/recommend', {
        cookie
    })
}


module.exports = {
    getHotSong,
    getSongUrl,
    getArtistInfo,
    getMvUrl,
    getAlbumInfo,
    getRecommendVideo
}